oracle.pg.text.solr

## Class SolrVertexAutoIndex

- java.lang.Object
- - oracle.pg.text.solr.SolrIndex<T>
  - - oracle.pg.text.solr.SolrAutoIndex<Vertex>
    - - oracle.pg.text.solr.SolrVertexAutoIndex

- All Implemented Interfaces:
    Index<Vertex>, OracleAutoIndex<Vertex>, OracleIndex<Vertex>
  Direct Known Subclasses:
    NoSQLSolrVertexAutoIndex

      public abstract class SolrVertexAutoIndex
      extends SolrAutoIndex<Vertex>
      implements OracleAutoIndex<Vertex>

  This class extends the functions defined in SolrAutoIndex. It manages automatic indexes defined on Vertex objects using SolrCloud.

- - ### Field Summary

    - ### Fields inherited from class oracle.pg.text.solr.SolrIndex

      `EDGE_ID_PROP, TYPE_DT_BOOL, TYPE_DT_DATE, TYPE_DT_DOUBLE, TYPE_DT_FLOAT, TYPE_DT_INTEGER, TYPE_DT_SERIALIZABLE, TYPE_DT_STRING, VERSION_PROP, VERTEX_ID_PROP`

    - ### Fields inherited from interface oracle.pg.text.OracleIndex

      `EDGE_ID_PROP, EDGE_LABEL_PROP, END_NODE_ID_PROP, START_NODE_ID_PROP, TYPE_DT_BOOL, TYPE_DT_DATE, TYPE_DT_DOUBLE, TYPE_DT_FLOAT, TYPE_DT_INTEGER, TYPE_DT_SERIALIZABLE, TYPE_DT_STRING, VERTEX_ID_PROP`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `SolrVertexAutoIndex(String indexName, OraclePropertyGraphBase oraclePropertyGraph, Parameter<String,Object>[] indexParameters, boolean erase)` Constructs a new SolrVertexAutoIndex object.

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `CloseableIterable<Vertex>` | `get(String key, Object value, Class dtClass, boolean acceptWildcard)` Gets all vertices indexed by the provided key/value.
    `String` | `getDocIdentifier()` Gets the document's identifier associated to this index.
    `Iterable<Vertex>` | `getElementsFromPG()` Gets an Iterable<Vertex> of vertices from the associated property graph.
    `Iterable<Vertex>` | `getElementsFromPG(String key)` Gets an Iterable<Vertex> of vertices from the associated property graph, matching the specified key.
    `Iterable<Vertex>` | `getElementsFromPG(String[] keys)` Gets an Iterable<Vertex> of vertices from the associated property graph, matching the specified keys.
    `CloseableIterable<Vertex>[]` | `getPartitioned(Object[] connections, String key, Object value, Class dtClass, boolean acceptWildcard, int startShardId)` Gets an array of `CloseableIterable` objects that hold all the elements with an attribute matching the given K/V pair.

    - ### Methods inherited from class oracle.pg.text.solr.SolrAutoIndex

      `close, closeConnectionsArray, containsIndexedKey, getConnectionsArray, getIndexedKeys, indexElements, indexElementsPartitioned, loadIndexedKeys, put, reindexElements, reindexElements, reindexElements, reindexElementsNoPartitioned, reindexElementsPartitioned, reindexElementsPartitioned, reindexElementsPartitioned`

    - ### Methods inherited from class oracle.pg.text.solr.SolrIndex

      `add, add, buildSearchTerm, buildSearchTerm, clearIndex, commit, count, count, count, dropIndex, get, get, getCloudSolrServer, getDirectoryName, getGraphName, getIndexClass, getIndexName, getIndexParameters, getOracleIndexParameters, getParameters, getPartitioned, getShardsNames, getTotalShards, getTotalShards, isDelBatchEmpty, isDelBatchFull, isUpdatesBatchEmpty, isUpdatesBatchFull, put, query, query, remove, remove, remove, remove, removeAll`

    - ### Methods inherited from class java.lang.Object

      `equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

    - ### Methods inherited from interface oracle.pg.text.OracleAutoIndex

      `closeConnectionsArray, containsIndexedKey, get, getConnectionsArray, getElementsFromPG, getIndexedKeys, getPartitionsNumber, indexElements, indexElementsPartitioned, loadIndexedKeys, reindexElements, reindexElements, reindexElements, reindexElementsNoPartitioned, reindexElementsPartitioned, reindexElementsPartitioned, reindexElementsPartitioned`

    - ### Methods inherited from interface oracle.pg.text.OracleIndex

      `add, buildSearchTerm, buildSearchTerm, clearIndex, close, commit, count, count, dropIndex, getDirectoryName, getGraphName, getIndexClass, getOracleIndexParameters, getParameters, getPartitioned, getTotalShards, isDelBatchEmpty, isDelBatchFull, isUpdatesBatchEmpty, isUpdatesBatchFull, query, refreshIndex, remove, removeAll`

    - ### Methods inherited from interface com.tinkerpop.blueprints.Index

      `count, get, getIndexName, put, query, remove`

- - ### Constructor Detail

    - #### SolrVertexAutoIndex

          public SolrVertexAutoIndex(String indexName,
                             OraclePropertyGraphBase oraclePropertyGraph,
                             Parameter<String,Object>[] indexParameters,
                             boolean erase)

      Constructs a new SolrVertexAutoIndex object.
      Parameters:
        `indexName` - the name of the index
        `oraclePropertyGraph` - an `OraclePropertyGraphBase` object.
        `indexParameters` - a collection of parameters for the underlying index implementation.
        `erase` - a boolean specifying if the index should be cleared at the beginning.

  - ### Method Detail

    - #### get

          public CloseableIterable<Vertex> get(String key,
                                      Object value,
                                      Class dtClass,
                                      boolean acceptWildcard)

      Gets all vertices indexed by the provided key/value.
      Specified by:
        `get` in interface `OracleIndex<Vertex>`
      Specified by:
        `get` in class `SolrIndex<Vertex>`
      Parameters:
        `key` - the key of the indexed elements.
        `value` - the value of the indexed elements.
        `acceptWildcard` - specifies if wild cards can be used in the value object.
        `dtClass` - the class representing the datatype of the property value. This can be used to cast the property value to a different datatype. For example, if the value is "3.01" and dtClass is Float.Class, then this value will be treated as a 3.01f.
      Returns:
        an iterable of elements that have a particular key/value in the index.

    - #### getDocIdentifier

          public String getDocIdentifier()

      Gets the document's identifier associated to this index.
      Specified by:
        `getDocIdentifier` in interface `OracleIndex<Vertex>`
      Overrides:
        `getDocIdentifier` in class `SolrIndex<Vertex>`
      Returns:
        the document's identifier associated to this index.

    - #### getElementsFromPG

          public Iterable<Vertex> getElementsFromPG()

      Gets an Iterable<Vertex> of vertices from the associated property graph.
      Specified by:
        `getElementsFromPG` in interface `OracleAutoIndex<Vertex>`
      Specified by:
        `getElementsFromPG` in class `SolrAutoIndex<Vertex>`
      Returns:
        an Iterable<Vertex> object.

    - #### getElementsFromPG

          public Iterable<Vertex> getElementsFromPG(String key)

      Gets an Iterable<Vertex> of vertices from the associated property graph, matching the specified key.
      Specified by:
        `getElementsFromPG` in interface `OracleAutoIndex<Vertex>`
      Parameters:
        `key` - the key to be queried over the property graph.
      Returns:
        an Iterable<Vertex> object.

    - #### getElementsFromPG

          public Iterable<Vertex> getElementsFromPG(String[] keys)

      Gets an Iterable<Vertex> of vertices from the associated property graph, matching the specified keys.
      Specified by:
        `getElementsFromPG` in interface `OracleAutoIndex<Vertex>`
      Parameters:
        `keys` - an array of keys to be queried over the property graph.
      Returns:
        an Iterable<Vertex> object.

    - #### getPartitioned

          public CloseableIterable<Vertex>[] getPartitioned(Object[] connections,
                                                   String key,
                                                   Object value,
                                                   Class dtClass,
                                                   boolean acceptWildcard,
                                                   int startShardId)

      Gets an array of `CloseableIterable` objects that hold all the elements with an attribute matching the given K/V pair. Each element in the `CloseableIterable` array uses a separate connection provided to fetch a subset of the results from a corresponding SolrCloud shard. Note that we assign an integer ID (in the range of [0, N - 1]) to all the shards in a SolrCloud cluster with N shards. The subset of shards queried will consist of those shards with ID value in the range of [startShardId, startShardId - 1 + size of connections array].
      Specified by:
        `getPartitioned` in interface `OracleIndex<Vertex>`
      Specified by:
        `getPartitioned` in class `SolrIndex<Vertex>`
      Parameters:
        `connections` - an array of connections to the SolrCloud. Each element of this array should be of type CloudSolrServer. See `SolrIndex.getCloudSolrServer(long)`.
        `key` - the key of a property
        `value` - the value object of the property.
        `dtClass` - the class representing the datatype of the property value. This can be used to cast the property value to a different datatype. For example, if the value is "3.01" and dtClass is Float.Class, then this value will be treated as a 3.01f.
        `acceptWildcard` - specifies if wild cards can be used in the value object.
        `startShardId` - the ID of the starting shard.
      Returns:
        a `CloseableIterable` object.

Copyright © 2015 Oracle and/or its afflilates. All Rights Reserved.